//
//  CarTypeInfoTableViewCell.m
//  OneCreditTreasure
//
//  Created by iOS Tedu on 16/8/30.
//
//

#import "CarTypeInfoTableViewCell.h"

@implementation CarTypeInfoTableViewCell
#pragma mark - 生命周期 life cycle
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self nCarLB];
        [self nCarBtn];
        [self secondLB];
        [self secondBtn];
    }
    return self;
}

#pragma mark - 懒加载 lazy loading
- (UIButton *)nCarBtn {
    if(_nCarBtn == nil) {
        _nCarBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        [self.contentView addSubview:_nCarBtn];
        [_nCarBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(kScreenW / 6);
            make.centerY.equalTo(0);
            make.width.equalTo(20);
            make.height.equalTo(20);
        }];
        myBtnSettings(1, [[UIColor blackColor] CGColor], [UIColor lightGrayColor], 10, _nCarBtn);
    }
    return _nCarBtn;
}

- (UILabel *)nCarLB {
    if(_nCarLB == nil) {
        _nCarLB = [[UILabel alloc] init];
        [self.contentView addSubview:_nCarLB];
        [_nCarLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.nCarBtn.mas_right).equalTo(20);
            make.top.equalTo(4);
            make.bottom.equalTo(-4);
            make.right.equalTo(self.secondBtn).equalTo(-8);
        }];
        _nCarLB.font = defaultFont;
    }
    return _nCarLB;
}

- (UIButton *)secondBtn {
    if(_secondBtn == nil) {
        _secondBtn = [UIButton buttonWithType:UIButtonTypeSystem];
        [self.contentView addSubview:_secondBtn];
        [_secondBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(kScreenW / 2);
            make.centerY.equalTo(0);
            make.width.equalTo(20);
            make.height.equalTo(20);
        }];
        myBtnSettings(1, [[UIColor blackColor] CGColor], [UIColor lightGrayColor], 10, _secondBtn);
    }
    return _secondBtn;
}

- (UILabel *)secondLB {
    if(_secondLB == nil) {
        _secondLB = [[UILabel alloc] init];
        [self.contentView addSubview:_secondLB];
        [_secondLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.secondBtn.mas_right).equalTo(20);
            make.top.equalTo(4);
            make.bottom.equalTo(-4);
            make.right.equalTo(-8);
        }];
        _secondLB.font = defaultFont;
    }
    return _secondLB;
}


@end
